<?php
/**
 * Created by PhpStorm.
 * User: yuliang
 * Date: 2017/6/2
 * Time: 上午11:02
 */

namespace app\common\model;


use think\Db;
use think\Model;

class Audition extends Model
{
    protected $autoWriteTimestamp = 'datetime';

    // 获取当前用户的观看记录
    public function seeNow($course_id,$user_id){
        $chapter = Db::name('audition')->where(['user_id'=>$user_id,'course_id'=>$course_id])->value('chapter_id');
        if($chapter){
            return $chapter;
        }
        return '';
    }
}